package com.zzyl.mapper;

import com.zzyl.entity.RoleResource;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleResourceMapper {

    @Select("select resource_no from sys_role_resource where role_id = #{roleId}")
    List<String> findCheckedResources(Long roleId);

    @Delete("delete from sys_role_resource where role_id = #{roleIds}")
    void deleteByRoleId(String roleIds);

    void batchInsert(@Param("list") List<RoleResource> roleResourceList);
}
